<?php
$tab1 = $db->select("
id, 
B.firstname, 
B.lastname, 
B.mail, 
B.phone, 
DATE_FORMAT(B.birthdate, '%e') AS jj, 
DATE_FORMAT(B.birthdate, '%m') AS mm, 
DATE_FORMAT(B.birthdate, '%Y') AS yyyy, 
(YEAR(CURRENT_DATE) - YEAR(B.birthdate)) - (RIGHT(CURRENT_DATE,5) <= RIGHT(B.birthdate,5)) +1 AS age, 
TO_DAYS(CONCAT(LEFT(CURRENT_DATE,5), RIGHT(B.birthdate, 5))) - TO_DAYS(CURRENT_DATE) AS dans",
$CONFIG['table_birthdays'].' B, '.$CONFIG['table_users'].' U',
"B.userlogin=U.login 
AND U.public_all=1 
AND U.login<>'".$_SESSION['login']."' 
AND B.birthdate IS NOT NULL",
"dans"
);
$tab2 = $db->select("
login,
firstname, 
lastname, 
mail, 
DATE_FORMAT(birthdate, '%e') AS jj, 
DATE_FORMAT(birthdate, '%m') AS mm, 
DATE_FORMAT(birthdate, '%Y') AS yyyy, 
(YEAR(CURRENT_DATE) - YEAR(birthdate)) - (RIGHT(CURRENT_DATE,5) <= RIGHT(birthdate,5)) +1 AS age, 
TO_DAYS(CONCAT(LEFT(CURRENT_DATE,5), RIGHT(birthdate, 5))) - TO_DAYS(CURRENT_DATE) AS dans",
$CONFIG['table_users'],
"public_one=1 
AND login<>'".$_SESSION['login']."' 
AND birthdate IS NOT NULL",
"dans"
);

if(count($tab2)>0){
	echo '<h3>Membres du site</h3>';
	echo '<ul>';
	$i = lister($tab2,'checkboxes');
	echo '</ul>';
}

if(count($tab1)>0){
	echo '<h3>Anniversaires de membres</h3>';
	echo '<ul>';
	$i+= lister($tab1,'checkboxes');
	echo '</ul>';
}
?>
